package com.pfzy.utildemo.activity.record.soundrecord.helper;

import android.util.ArraySet;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

//import com.pfzy.sdk.soundrecord.db.AudioFileInfo;
//import com.pfzy.sdk.soundrecord.db.DbManager;
//import com.pfzy.sdk.soundrecord.upload.Dto.UploadAudioInfo;
//import com.pfzy.sdk.soundrecord.upload.UpLoadHelper;
//import com.pfzy.sdk.soundrecord.util.Logger;

import com.pfzy.utildemo.activity.record.soundrecord.db.AudioFileInfo;
import com.pfzy.utildemo.activity.record.soundrecord.upload.Dto.UploadAudioInfo;
import com.pfzy.lib.config.log.MyLog;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

/**
 * 上传检查助手
 */
public class CheckUploadHelper {
    /**
     * 音频文件信息 2 组id集
     */
//    public static Set<String> audioFileInfo2GroupidSet(@Nullable List<AudioFileInfo> list) {
//        MyLog.logd("上传检查助手 " + "AudioFileInfo2GroupidSet() 开始 list=" + list);
//        if (list == null || list.size() == 0) {
//            return null;
//        }
//        Set<String> set = null;
//        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
//            set = new ArraySet<>();
//            for (AudioFileInfo fileInfo : list) {
//                set.add(fileInfo.getGroupid());
//            }
//        }
//
//        MyLog.logd("上传检查助手 " + "AudioFileInfo2GroupidSet() 结束 set=" + set);
//        return set;
//    }

//    /**
//     * 音频文件信息 to 上传信息
//     */
//    public static UploadAudioInfo audioFileInfoList2UploadInfo(List<AudioFileInfo> list) {
//        AudioFileInfo fileInfo = list.get(0);
//        // 文件列表 to 路径列表
//        ArrayList<String> pathList = UpLoadHelper.fileList2PathList(list);
//        UploadAudioInfo uploadInfo = new UploadAudioInfo(fileInfo.getUtype(), fileInfo.getRecordType(), "" + fileInfo.getBizLine(), fileInfo.getOrderNo(), "" + DbManager.getInstance().queryStartTimeStampByGroupId(fileInfo.getGroupid()), fileInfo.getUid(), pathList);
//        return uploadInfo;
//    }
//
//    /**
//     * 单个音频文件信息 to 上传信息
//     */
//    public static UploadAudioInfo singleAuidoFileInfo2UplaodInfo(@NonNull AudioFileInfo singleFileInfo) {
//        ArrayList<String> pathList = new ArrayList<>();
//        pathList.add(singleFileInfo.getAudioFilePath());
//        UploadAudioInfo uploadAudioInfo = new UploadAudioInfo(singleFileInfo.getUtype(), singleFileInfo.getRecordType(), "" + singleFileInfo.getBizLine(), singleFileInfo.getOrderNo(), "" + singleFileInfo.getRecordStartTime(), singleFileInfo.getUid(), pathList);
//        return uploadAudioInfo;
//    }

    private void _logd(String msg) {
        MyLog.logd("上传检查助手 " + msg);
    }

    private void _loge(String msg) {
        MyLog.loge("上传检查助手 " + msg);
    }
}
